<template>
    <div style="height: 400px;width: 380px;border: 1px #ff4400 dashed;margin: 5px;">
        <h3>乌鲁木齐</h3>
        <button @click="addUserHandler">通知北京的同事添加我的信息</button>
        <br/>
        <br/>
        <button @click="removeUserHandler">删除我的信息</button>
    </div>
</template>

<script>
    export default {
        name: "wlmq",
        computed: {
            userName: {
                get() {
                    return this.$store.state.user.name
                },
                set(val) {
                    this.$store.commit('user/updateName', val)
                }
            },
            post: {
                get() {
                    return this.$store.state.post
                },
                set(val) {
                    this.$store.commit('updatePost', val)
                }
            },
            work: {
                get() {
                    return this.$store.state.workAddress
                },
                set(val) {
                    this.$store.commit('updateWorkAddress', val)
                }
            }
        },
        methods: {
            addUserHandler() {
                this.userName = "许亚恒"
            },
            removeUserHandler() {
                this.userName = ""
                this.post = ""
                this.work = ""
            }
        }
    }
</script>

<style scoped>

</style>
